<?php
/* gioi thieu*/
$echo = '<div class="content">';
$home = mysql_query("SELECT description,menu_id FROM info WHERE lang='{$lang}' AND id=".home_gioithieu);
$row = mysql_fetch_array($home);
$url_link = $tc->link_detail($row['menu_id']);
$echo .= '<div class="box1"><h2>'.name_gioithieu.'</h2><div style="line-height:20px; height:270px; overflow:hidden">'.$row['description'].'<a href="'.$url_link.'" style="display:block; color:#C3262D; margin-top:10px">&gt;&gt; xem thêm</a></div></div>';

$echo .= '<div class="box2"><div class="item1"><h2>'.name_nghiencuu.'</h2><img width="110" height="85" src="upload/images/danhmuc/nghien-cuu.jpg" alt="'.name_nghiencuu.'" />';
$home = mysql_query("SELECT id,name,name_rewrite,menu_id FROM info WHERE lang='{$lang}' AND `delete`=0 AND status=1 AND menu_id LIKE '%,".home_nghiencuu.",%' ORDER BY date_update DESC LIMIT 6");
while($row = mysql_fetch_array($home)){
	$url_link = $tc->link_detail($row['menu_id']);
	$echo .= '<li><a href="'.$url_link.$row['name_rewrite'].'.html">&gt; '.$row['name'].'</a></li>';
}
$echo .= '<div style="clear:both; height:2px"></div></div><div class="item2"><h2>'.name_giaiphap.'</h2><img width="110" height="85" src="upload/images/danhmuc/giai-phap.jpg" alt="'.name_giaiphap.'" />';
$home = mysql_query("SELECT id,name,name_rewrite,menu_id FROM info WHERE lang='{$lang}' AND `delete`=0 AND status=1 AND menu_id LIKE '%,".home_giaiphap.",%' ORDER BY date_update DESC LIMIT 6");
while($row = mysql_fetch_array($home)){
	$url_link = $tc->link_detail($row['menu_id']);
	$echo .= '<li><a href="'.$url_link.$row['name_rewrite'].'.html">&gt; '.$row['name'].'</a></li>';
}
$echo .= '<div style="clear:both"></div></div></div><div style="clear:both"></div></div>';

/* chuong trinh */
$home = mysql_query("SELECT id,name,name_rewrite,description,menu_id FROM info WHERE lang='{$lang}' AND `delete`=0 AND status=1 AND menu_id LIKE '%,".home_chuongtrinh.",%' ORDER BY date_update DESC");
$echo .= '<div class="content"><div class="box1"><h2>'.name_chuongtrinh.'</h2><p><img src="upload/images/danhmuc/chuong-trinh.jpg" alt="'.name_chuongtrinh.'" /></p></div><div class="box2">';
while($row = mysql_fetch_array($home)){
	$url_link = $tc->link_detail($row['menu_id']);
	$echo .= '<li style="width:305px"><a href="'.$url_link.$row['name_rewrite'].'.html"><h4 style="text-decoration:none">&gt; '.$row['name'].'</h4></a></li>';
}
$echo .= '</div><div style="clear:both"></div></div>';

/* tin tuc */
$home = mysql_query("SELECT id,name,name_rewrite,description,menu_id FROM info WHERE lang='{$lang}' AND `delete`=0 AND status=1 AND menu_id LIKE '%,".home_tintuc.",%' ORDER BY date_update DESC LIMIT 2");
$echo .= '<div class="content"><div class="box1"><h2>'.name_tintuc.'</h2><p><img src="upload/images/danhmuc/tin-tuc.jpg" alt="'.name_tintuc.'" /></p></div><div class="box2"><div class="item3">';
while($row = mysql_fetch_array($home)){
	$url_link = $tc->link_detail($row['menu_id']);
	$echo .= '<h4>'.$row['name'].'</h4><p> &nbsp; '.$row['description'].'<a href="'.$url_link.$row['name_rewrite'].'.html" style="display:block; text-align:right; color:#C3262D">&gt;&gt; xem thêm</a></p>';
}
$echo .= '</div><div class="item4"><p><b>Hotline:</b> '.$row_config['hotline'].'</p><p style="margin-bottom:3px"><b>Email:</b> info@rehmi.org</p>
<p style="margin-top:-6px; margin-bottom:3px"><a style="line-height:22px" href="ymsgr:sendIM?'.$row_config['yahoo'].'"><img style="float:left; margin-top:5px" src="http://opi.yahoo.com/online?u='.$row_config['yahoo'].'&m=g&t=0" border=0> &nbsp;<b>Hỗ trợ trực tuyến</b></a></p>
<div class="fb-like" data-href="https://www.facebook.com/RehmiInstitute" data-send="true" data-layout="button_count" data-width="150" data-show-faces="true"></div>
        <div id="fb-root"></div>
		<script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) return;
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/vi_VN/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
</div></div><div style="clear:both"></div></div>';

echo $echo;
mysql_free_result($home);
?>